<html>
    <head>
        <title>test scf</title>
    </head>
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>

    <body>
        <p>测试上传数据</p>
        <div id="addmsg">
            <form id="form1" onsubmit="return false" action="##" method="post">
                <p>msg: <input name="msg" value="test"></p>
                <p><input type="submit" value="上传到服务端" id="msgpost"></p>
            </form>
        </div>
        <p>测试下载数据</p>
        <div>
            <button id="getmsg">获取服务端数据</button>
        </div>
        <div id="msg"></div>
    </body>
    <script>
        $(document).ready(function () {
            // 下载
            $("#getmsg").click(function () {
                let api = "https://service-lbemmqjs-1253797486.gz.apigw.tencentcs.com/release/hello";
                let proxy = "https://cors-anywhere.herokuapp.com/" + api;
                $.ajax({
                    url: proxy
                }).done((data)=>{
                    $("#msg").append(JSON.stringify(data));
                }).fail(()=>{
                    $("#msg").text("get error");
                });
            });
        });
    </script>

</html>